package gpl.androidcommons.app;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;

public class AlertDialogFactory {

  private AlertDialogFactory() {
  }

  public static AlertDialog.Builder getYesNoBuilder(Context context, int title, int msg, OnClickListener yesListener,
      OnClickListener noListener) {
    return getYesNoBuilder(context, context.getString(title), context.getString(msg), yesListener, noListener);
  }

  public static AlertDialog.Builder getYesNoBuilder(Context context, String title, String msg, OnClickListener yesListener,
      OnClickListener noListener) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context).setTitle(title).setMessage(msg);
    builder.setCancelable(false);
    builder.setNegativeButton(android.R.string.no, noListener);
    builder.setPositiveButton(android.R.string.yes, yesListener);
    return builder;
  }
}
